<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>
        1.输出100-200之间所有的质数
    </p>
    <input type="button" value="计算" onclick="getPrime()">
    <span id="span"></span>
    <script>
        //1.输出100-200之间所有的质数
        function getPrime() {
            sumPrime = '';
            for (let i = 100; i <= 200; i++) {
                for (let j = 2; i % j; j++) {
                    if (j == (i - 1))
                        sumPrime += ' ' + i;
                }
            }
            document.getElementById('span').innerHTML = sumPrime;
        }

    </script>
</body>

</html>